using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmBorrow")]
    public class Borrow
    {

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "BorrowId", ResourceType = typeof(Resources.BorrowsResource))]
        public int BorrowId { get; set; }

		[ForeignKey("ResType")]
		[DataMember, Display(Name = "ResTypeId", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> ResTypeId { get; set; }

		[DataMember, Display(Name = "TranDate", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<System.DateTime> TranDate { get; set; }

		[DataMember, Display(Name = "BorrowName", ResourceType = typeof(Resources.BorrowsResource))]
        public string BorrowName { get; set; }

		[DataMember, Display(Name = "Remarks", ResourceType = typeof(Resources.BorrowsResource))]
        public string Remarks { get; set; }

		[ForeignKey("FromJobSite")]
		[DataMember, Display(Name = "FromJobSiteId", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> FromJobSiteId { get; set; }

		[ForeignKey("ToJobSite")]
		[DataMember, Display(Name = "ToJobSiteId", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> ToJobSiteId { get; set; }

		[DataMember, Display(Name = "DateToReturn", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<System.DateTime> DateToReturn { get; set; }

		[ForeignKey("Status")]
		[DataMember, Display(Name = "StatusId", ResourceType = typeof(Resources.BorrowsResource))]
        public string StatusId { get; set; }

		[DataMember, Display(Name = "ApprovedDate", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<System.DateTime> ApprovedDate { get; set; }

		[DataMember, Display(Name = "ApprovedBy", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> ApprovedBy { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

		[ForeignKey("ToIcmWh")]
		[DataMember, Display(Name = "ToIcmWhId", ResourceType = typeof(Resources.BorrowsResource))]
        public Nullable<int> ToIcmWhId { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.BorrowsResource))]
        public string RecordStatus { get; set; }

        public virtual ICM.MasResourceType ResType { get; set; }

        public virtual HRM.Employee FromJobSite { get; set; }

        public virtual HRM.JobSite ToJobSite { get; set; }

        public virtual HRM.DcStatus Status { get; set; }

        public virtual HRM.Employee ToIcmWh { get; set; }

    }
}